import {ref, computed} from 'vue'
import {defineStore} from 'pinia'

// 种群信息
export const usePicTempStore = defineStore('picTemp', () => {
    const picTemp = ref({
        originPic: null,
        aiPic: null
    })
    // 获取响应式对象
    const getPicTemp = computed(() => picTemp)

    // 更新方法
    function updataOriginPic(picFile) {
        picTemp.value.originPic = picFile
    }

    function updataAiPic(picFile) {
        picTemp.value.aiPic = picFile
    }

    function clearData() {
        picTemp.value = {
            originPic: null,
            aiPic: null
        }
    }

    return {picTemp, getPicTemp, updataOriginPic, updataAiPic, clearData}
})
